package com.shaomengjie.smjmvp.retrofit.utils;

import android.widget.Toast;

import com.shaomengjie.smjmvp.view.core.BaseActivity;

import rx.Subscriber;

/**
 * Created by shaomengjie on 2017/4/7.
 * pdsshaomengjie@live.com
 */

public abstract class BaseSubscriber<T> extends Subscriber<T> {
    private BaseActivity context;
    public BaseSubscriber(BaseActivity context){
        this.context = context;
    }

    @Override
    public void onStart() {
        super.onStart();
        if (!OkHttpUtils.isNetworkReachable(context)) {
            Toast.makeText(context, "当前网络不可用，请检查网络情况", Toast.LENGTH_SHORT).show();
            onCompleted();
            return;
        }
    }

    @Override
    public void onCompleted() {

    }
}
